<?php

namespace variant\library\vari;

/**
 * 注册树模式
 *
 * Class Register
 * @package variant
 */
class Register
{
    protected static $objects;

    public static function set($alias, $object)
    {
        self::$objects[$alias] = $object;
    }

    public static function get($alias)
    {
        return self::$objects[$alias] ?? null;
    }

    public static function has($alias)
    {
        return isset(self::$objects[$alias]);
    }

    public static function _unset($alias)
    {
        unset(self::$objects[$alias]);
    }
}